import { uploadImg, uploadImgApi } from "@/api/t100";

export default {
    state: {
        jsapiTicket: {}
    },
    getters: {},
    mutations: {
        setJsapiTicket(store, ticket) {
            store.jsapiTicket = ticket;
        }
    },
    actions: {
        uploadImg({ commit }, payload) {
            return new Promise((resolve, reject) => {
                uploadImg(payload)
                    .then(res => {
                        resolve(res);
                    })
                    .catch(err => {
                        reject(err);
                    });
            });
        },
        uploadImgApi({ commit }, payload) {
            return new Promise((resolve, reject) => {
                uploadImgApi(payload)
                    .then(res => {
                        resolve(res);
                    })
                    .catch(err => {
                        reject(err);
                    });
            });
        }
    },
    namespaced: true
};
